<?xml version="1.0" encoding="UTF-8"?>
<!--
To change this template, choose Tools | Templates
and open the template in the editor.
-->
<!DOCTYPE html>
<ui:composition template="/Menu.xhtml"
                xmlns="http://www.w3.org/1999/xhtml"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:p="http://primefaces.org/ui"                
                xmlns:c="http://java.sun.com/jsp/jstl/core">
    <ui:define name="body">
        <h:form id="form">
            <p:growl id="growl" />
            <p:panel header="LISTA DE SUPERVISORES UNIVERSITARIOS">
                <p:dataTable style="width: 750px" paginator="true" rows="10" rowKey="#{supervisor.idSupervisor}" id="listaSupervisores" var="supervisor" value="#{listaSupervisoresBean.supervisor}" widgetVar="dataSupervisores" >  
                <f:facet name="header">  
                    <table>
                        <tr>
                            <td>
                                Supervisores
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <p:outputPanel>  
                                    <h:outputText value="Buscar:" />  
                                    <p:inputText id="globalFilter" onkeyup="dataSupervisores.filter()" style="width:150px" />  
                                </p:outputPanel>  
                            </td>
                        </tr>
                    </table>
                </f:facet>  
                <p:column headerText="Código" style="width:12%" sortBy="#{supervisor.idSupervisor}" filterBy="#{supervisor.idSupervisor}" filterMatchMode="contains">  
                    <h:outputText value="#{supervisor.idSupervisor}" />  
                </p:column>  
                <p:column headerText="Nombres / Apellidos" style="width:72%" sortBy="#{supervisor.nombresSupervisor} #{supervisor.apellido1Supervisor} #{supervisor.apellido2Supervisor}" filterBy="#{supervisor.nombresSupervisor} #{supervisor.apellido1Supervisor} #{supervisor.apellido2Supervisor}" filterMatchMode="contains">  
                    <h:outputText value="#{supervisor.nombresSupervisor} #{supervisor.apellido1Supervisor} #{supervisor.apellido2Supervisor}" />  
                </p:column> 
                <p:column headerText="Habilitar" style="width:8%">
                    <p:selectBooleanButton value="#{supervisor.estadoSupervisor}" onLabel="Si" offLabel="No">
                        <p:ajax process="@this" update="@this, :form:growl" listener="#{listaSupervisoresBean.actualizarSupervisorUniversitario(supervisor)}"></p:ajax>                            
                    </p:selectBooleanButton> 
                </p:column>
                <p:column headerText="Detalle" style="width:8%">  
                    <p:commandButton id="selectButton3" oncomplete="dlgDetalleSupervisorUniv.show();" update=":form:display"  icon="ui-icon-search" title="Ver Detalle">                          
                        <f:setPropertyActionListener value="#{supervisor}" target="#{listaSupervisoresBean.supervisorSelected}"></f:setPropertyActionListener>
                    </p:commandButton>                    
                </p:column>  
            </p:dataTable>
            </p:panel>
            <p:dialog header="Detalle Supervisor" modal="true" showEffect="fade" hideEffect="fade" widgetVar="dlgDetalleSupervisorUniv">  
                <p:outputPanel id="display"> 
                    <h:panelGrid columns="2" cellpadding="5">  
                        <h:outputLabel value="Codigo:" style="font-weight:bold" />  
                        <h:outputText  value="#{listaSupervisoresBean.supervisorSelected.idSupervisor}" />   
                        <h:outputLabel value="Nombres y Apellidos:" style="font-weight:bold"/>  
                        <h:outputText  value="#{listaSupervisoresBean.supervisorSelected.nombresSupervisor} #{listaSupervisoresBean.supervisorSelected.apellido1Supervisor} #{listaSupervisoresBean.supervisorSelected.apellido2Supervisor}" />
                        <h:outputLabel value="Cargo:" style="font-weight:bold" />
                        <h:outputText  value="#{listaSupervisoresBean.supervisorSelected.cargoSupervisor}" />
                        <h:outputLabel value="Profesión:" style="font-weight:bold" />
                        <h:outputText  value="#{listaSupervisoresBean.supervisorSelected.profesionSupervisor}" />
                        <h:outputLabel value="Telefono:" style="font-weight:bold" />
                        <h:outputText  value="#{listaSupervisoresBean.supervisorSelected.telefonoSupervisor}" />
                        <h:outputLabel value="Celular" style="font-weight:bold" />
                        <h:outputText  value="#{listaSupervisoresBean.supervisorSelected.celularSupervisor}" />
                        <h:outputLabel value="Correo:" style="font-weight:bold" />
                        <h:outputText  value="#{listaSupervisoresBean.supervisorSelected.correoSupervisor}" />
                        <h:outputLabel value="Dirección:" style="font-weight:bold" />
                        <h:outputText  value="#{listaSupervisoresBean.supervisorSelected.direccionSupervisor}" />
                    </h:panelGrid>        
                </p:outputPanel>
            </p:dialog>
   
        </h:form>    
    </ui:define>
</ui:composition>